/**
 * ConcreteMessage.java
 * ************************** 
 * @date Mar 23, 2011
 * @author Michele Tamburini
 * 
 * **************************
 */
package gossipServices.gossipMessages;


import messages.GeneralMessage;
import gossipServices.basic.nodeDescriptors.NodeDescriptor;

/**
 * Description: 
 * A GeneralGossipMessage differs from a GeneralMessage by the
 * existence of an additional field: gossipThread.
 * The field gossipThread is used to understand what thread,
 * (the active or the passive one), has sent the current message.
 * This information may be used to dispatch incoming messages
 * in different queues for the active and the passive
 * thread of the gossip protocol.
 *
 */
public class GeneralGossipMessage extends GeneralMessage{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	protected Object gossipThread;

	public GeneralGossipMessage(){
		super();
		createID();
	}
		
	public GeneralGossipMessage(NodeDescriptor sender,
			NodeDescriptor dest, Object body, Object gossipThread) {
		super();
		this.body = body;
		this.sender = sender;
		this.dest = dest;
		this.gossipThread = gossipThread;
		createID(this.sender.getNodeName());
	}

	/**
	 * @param sender
	 * @param dest
	 */
	public GeneralGossipMessage(NodeDescriptor sender, NodeDescriptor dest) {
		this.sender = sender;
		this.dest = dest;
		createID(sender.getNodeName());
	}

	public final Object getGossipThread() {
		return gossipThread;
	}

}
